<template>
  <div class="list_item" @click="getDetailFn(dataItem)">
    <div class="avatar">
      <img :src="dataItem.url" alt="" />
    </div>
    <div class="text">
      <div class="top flex align-items">
        <h3>{{ dataItem.doctorName }}</h3>
        <img :src="dataItem.video == '是' ? stateTUrl : stateFUrl" alt="" />
        <span>{{ dataItem.department }}</span>
        <span>{{ dataItem.doctorTile }}</span>
      </div>
      <div class="lv flex align-items">
        <i>{{ dataItem.departMentLevel }}</i>
        <span>{{ dataItem.hospital }}</span>
      </div>
      <p>擅长：{{ dataItem.specialty }}</p>
      <div class="bottom">
        <span @click.stop="toOrderForm('1')"
          >图文 <i>￥{{ dataItem.grahPrice }}</i></span
        >
        <span @click.stop="toOrderForm('2')"
          >视频 <i>￥{{ dataItem.videoPrice }}</i></span
        >
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: "List",
  props: {
    dataItem: {
      type: Object,
      default() {
        return {};
      }
    }
  },
  data() {
    return {
      stateTUrl: require("@/views/index/image/v_icon1.png"),
      stateFUrl: require("@/views/index/image/v_icon2.png")
    };
  },
  methods: {
    getDetailFn(item) {
      this.$emit("getDetailFn", item);
    },
    toOrderForm(item) {
      const obj = this.dataItem;
      obj.type = item;
      this.$emit("toOrderForm", obj);
    }
  }
};
</script>
<style lang="less" scope>
.list_item {
  border-top: 1px solid #eee;
  padding-top: 0.26rem;
  margin-bottom: 0.19rem;
  display: flex;
  .avatar {
    width: 0.55rem;
    min-width: 0.55rem;
    height: 0.55rem;
    border-radius: 0.55rem;
    margin-right: 0.2rem;
    background: #eee;
    overflow: hidden;
    img {
      width: 100%;
      display: block;
    }
  }
  .top {
    margin-bottom: 0.03rem;
    h3 {
      font-size: 0.16rem;
      color: #2b2b2b;
      height: 0.22rem;
      line-height: 0.22rem;
      margin-right: 0.1rem;
    }
    img {
      width: 0.16rem;
      height: 0.16rem;
      margin-right: 0.04rem;
      display: block;
    }
    span {
      margin-right: 0.1rem;
    }
  }
  .lv {
    margin-bottom: 0.08rem;
    i {
      display: block;
      width: 0.22rem;
      text-align: center;
      background: #999;
      color: #fff;
      font-size: 0.08rem;
      border-radius: 0.02rem;
      line-height: 0.12rem;
      height: 0.12rem;
      margin-right: 0.04rem;
      display: block;
    }
    span {
      color: #666;
      font-size: 0.1rem;
      height: 0.14rem;
      line-height: 0.14rem;
    }
  }
  p {
    color: #999;
    line-height: 0.14rem;
    text-overflow: -o-ellipsis-lastline;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    margin-bottom: 0.13rem;
    line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .bottom {
    span {
      margin-right: 0.21rem;
      color: #999;
      i {
        color: #fe7d7d;
      }
    }
  }
}
</style>
